import TabsView from '@/layouts/tabs/TabsView'
import BlankView from '@/layouts/BlankView'
import PageView from '@/layouts/PageView'

// 路由配置
const options = {
    routes: [
        {
            path: '/login',
            name: '登录页',
            component: () => import('@/pages/login')
        },
        {
            path: '*',
            name: '404',
            component: () => import('@/pages/exception/404'),
        },
        {
            path: '/403',
            name: '403',
            component: () => import('@/pages/exception/403'),
        },
        {
            path: '/',
            name: '首页',
            component: TabsView,
            redirect: '/login',
            children: [
                {
                    path: 'dashboard',
                    name: '仪表盘',
                    meta: {
                        icon: 'dashboard',
                        page: {
                            closable: false
                        }
                    },
                    component: () => import('@/pages/dashboard')
                },
                {
                    path: 'user',
                    name: '用户管理',
                    meta: {
                        icon: 'user',
                    },
                    component: BlankView,
                    children: [
                        {
                            path: 'user',
                            name: '用户管理',
                            component: () => import('@/pages/user'),
                        },
                        {
                            path: 'advice',
                            name: '用户反馈',
                            component: () => import('@/pages/advice')
                        }
                    ]
                },{
                    path: 'task',
                    name: '任务中心',
                    meta: {
                        icon: 'solution'
                    },
                    component: PageView,
                    children:[
                        {
                            path: 'banner',
                            name: '任务管理',
                            component: () => import('@/pages/task'),
                        }
                    ]
                },
                {
                    path: 'adv',
                    name: '广告管理',
                    meta: {
                        icon: 'form'
                    },
                    component: PageView,
                    children: [
                        {
                            path: 'banner',
                            name: '轮播图管理',
                            component: () => import('@/pages/banner'),
                        }, {
                            path: 'notice',
                            name: '通知管理',
                            component: () => import('@/pages/notice'),
                        }
                    ]
                },
                /*{
                    path: 'exception',
                    name: '异常页',
                    meta: {
                        icon: 'warning',
                    },
                    component: BlankView,
                    children: [
                        {
                            path: '404',
                            name: 'Exp404',
                            component: () => import('@/pages/exception/404')
                        },
                        {
                            path: '403',
                            name: 'Exp403',
                            component: () => import('@/pages/exception/403')
                        },
                        {
                            path: '500',
                            name: 'Exp500',
                            component: () => import('@/pages/exception/500')
                        }
                    ]
                },*/
                {
                    name: '验权页面',
                    path: 'auth/dashboard',
                    meta: {
                        icon: 'file-ppt',
                        authority: {
                            permission: 'form',
                            role: 'manager'
                        },
                        component: () => import('@/pages/dashboard')
                    }
                }
            ]
        }
    ]
}

export default options
